package com.cmc.cloud.cmclink.doc.vo.voyagebsavo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.*;

import org.springframework.format.annotation.DateTimeFormat;

import static com.cmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * bsa （base space Allocation） 维护 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VoyageBsaBaseVO {

    @Schema(description = "模板标记", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{VoyageBsaBaseVO.isTemplate.NotNull}")
    private Boolean isTemplate;

    @Schema(description = "进出口类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{VoyageBsaBaseVO.exImType.NotBlank}")
    @Length(max = 10, message = "{VoyageBsaBaseVO.exImType.Length}")
    private String exImType;

    @Schema(description = "航线代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{VoyageBsaBaseVO.laneCode.NotBlank}")
    @Length(max = 50, message = "{VoyageBsaBaseVO.laneCode.Length}")
    private String laneCode;

    @Schema(description = "船舶代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{VoyageBsaBaseVO.vesselCode.NotBlank}")
    @Length(max = 50, message = "{VoyageBsaBaseVO.vesselCode.Length}")
    private String vesselCode;

    @Schema(description = "航次")
    @Length(max = 50, message = "{VoyageBsaBaseVO.voyage.Length}")
    private String voyage;

    @Schema(description = "港口代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{VoyageBsaBaseVO.polCodes.NotBlank}")
    @Length(max = 50, message = "{VoyageBsaBaseVO.polCodes.Length}")
    private String polCodes;

    @Schema(description = "bsa箱量teu")
    private Integer bsaTeu;

    @Schema(description = "bsa重量吨")
    private Integer bsaTons;

    @Schema(description = "张力teu")
    private Integer optionTeu;

    @Schema(description = "张力重量吨")
    private Integer optionTons;

    @Schema(description = "冷插数")
    private Integer rfUnit;

    @Schema(description = "HC（teu")
    private Integer hcTeu;

    @Schema(description = "危险品占比teu")
    private BigDecimal maxDgPercent;

    @Schema(description = "危险品定额teu")
    private Integer maxDgTeu;

    @Schema(description = "全船接载开关", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{VoyageBsaBaseVO.bookingOpenStatus.NotNull}")
    private String bookingOpenStatus;

    @Schema(description = "全船接载开关人")
    @Length(max = 64, message = "{VoyageBsaBaseVO.openCloseUser.Length}")
    private String openCloseUser;

    @Schema(description = "全船接载开关时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime openCloseTime;

    @Schema(description = "备注")
    @Length(max = 255, message = "{VoyageBsaBaseVO.remark.Length}")
    private String remark;
}
